import Vue from 'vue'
import Router from 'vue-router'
import HelloWorld from '@/components/HelloWorld'
import Login from "../pages/Login"
import B from "../pages/B"

Vue.use(Router)
Vue.mixin({
    beforeCreate(){
        console.log('111111111111111111111111111')
        if(this.$route.meta.title){
            document.title = this.$route.meta.title
        }else{
            document.title = 'hello world'
        }
    }
})
export default new Router({
  routes: [
    {
      path: '/',
      name: 'HelloWorld',
      component: HelloWorld,
      meta:{
        title : 'HelloWorld'
      }
    },
    {
        path: '/login',
        component: Login,
        meta:{
            title : 'login'
        }
    }
  ]
})



